<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
	 <meta charset="utf-8">
	 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	 <title th:replace="common/base::pagetitle"></title>
	 <link th:replace="common/base::static"/>
	 <link rel='stylesheet' th:href="@{/static/css/element.ui.2.13.2.index.css}">
</head>
<body style="background-color: #f2f2f2;">

<div id="kPage" class="layui-fluid" style="padding: 0">
	 
	 <div class="layui-row wlb-fluid-padding15">
		  
		  <div class="layui-col-md12">
				
				<div class="layui-card">
					 <!--					 <div class="layui-card-header">流程图</div>-->
					 <!--					 1 ——> 2 ——> 3 ——> 4-->
					 <div class="layui-card-body">
						  <div class="layui-form" lay-filter="">
								<table id="bankInfoTable" lay-data="{id: 'id'}" lay-filter="bankInfoTable"></table>
								<div class="layui-form-item layui-hide">
									 <!--									 <input type="button" lay-submit="" lay-filter="kFormCheck" id="kFormCheck" value="验证凭证">-->
									 <input type="text" id="tradeId" name="tradeId" th:value="${tradeId}" placeholder="保存ID" autocomplete="off" class="layui-input">
									 <input type="text" id="compId" name="compId" th:value="${compId}" placeholder="保存ID" autocomplete="off" class="layui-input">
								</div>
						  </div>
					 </div>
				</div>
		  
		  </div>
	 </div>
</div>

<script th:replace="common/base::context"></script>
<script th:replace="common/base::mainjs"></script>
<script type="text/javascript" th:inline="javascript">
	 var ttable;
    layui.use(['form', 'table'], function () {
        var $ = layui.$, form = layui.form, table = layui.table;
        ttable = table;
        //加载银行列表
        table.render($.extend(config.layui.table, {
            elem: '#bankInfoTable'
            , url: BASE_WEB + 'voucher/financing/bankList?compId=' + $("#compId").val() //数据接口
            , cols: [[ //表头
                {type: 'radio', fixed: 'left'}
                , {field: 'id', title: '银行ID', hide: true, width: 100}
                , {field: 'compName', title: '银行名称', width: 100}
                , {field: 'comCerNo', title: '工商注册号', width: 100}
                // , {field: 'accountId', title: '签名账号',  width: 180}
                , {field: 'comAddress', title: '公司地址', width: 120}
                , {field: 'admName', title: '管理人姓名', width: 120}
                , {field: 'admMobPhone', title: '手机号码', sort: true, width: 150}
            ]]
				, done: function(res, curr, count){      //禁止选中
                layui.each(res.data, function(i, item){
                    if(!item.selected){
                        $(".layui-table tr[data-index="+i+"] input[type='checkbox']").prop('disabled',true);
                        //禁止选中样式
                        $(".layui-table tr[data-index="+i+"] input[type='checkbox']").next().addClass('layui-btn-disabled');
                        //设置背景颜色
                        $(".layui-table tr[data-index="+i+"]").css("background-color", "#EEEED1").find('td').prop('disabled',true)
                    }
                });
            }
        }));

       
    })
    function getCheck(){
        //获取表格选中数据
        var checkStatus = ttable.checkStatus('bankInfoTable');
        //交给父页面去校验
        // if (checkStatus.data.length <= 0) {
        //     wlbKit.errorMsg("请选择至少选择一条验收数据");
        //     return false;
        // }
        var bankId;//银行ID
        $(checkStatus.data).each(function (i, o) {//o即为表格中一行的数据
            bankId = o.id;
        });
        console.log("111" + bankId);
        return bankId;
    }
</script>

</body>
</html>